{extend name="public/base" /}
{block name="content"}
<div class="page-content">
    <!-- Page Breadcrumb -->
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li class="active">
                <i class="fa fa-home"></i>&nbsp;栏目管理
            </li>
            <li>
                栏目修改
            </li>
        </ul>
    </div>
    <!-- /Page Breadcrumb -->
    <!-- Page Body -->
    <div class="page-body">
        <div class="row">
            <div class="col-xs-12">
                <div class="widget radius-bordered">
                    <div class="widget-header bordered-bottom bordered-themeprimary">
                        <span class="widget-caption">栏目修改<small style="margin-left: 15px;">原名称:{$softwareInfo.softwarename}</small></span>
                    </div>
                    <div class="widget-body">
                        <form class="form-horizontal">
                            <input type="hidden" name="id" value="{$softwareInfo.id}">
                            <div class="form-group">
                                <label for="softwarename" class="col-sm-2 control-label no-padding-right">程序名称</label>
                                <div class="col-sm-6">
                                    <input type="text"   value="{$softwareInfo.softwarename}"   class="form-control" id="softwarename" name="softwarename" placeholder="栏目名称" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="version" class="col-sm-2 control-label no-padding-right">程序版本</label>
                                <div class="col-sm-6">
                                    <input type="text"  value="{$softwareInfo.version}"    class="form-control" id="version" name="version" placeholder="1.0" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="notice" class="col-sm-2 control-label no-padding-right">程序公告</label>
                                <div class="col-sm-6">
                                    <input type="text"   value="{$softwareInfo.notice}"   class="form-control" id="notice" name="notice" placeholder="更新公告" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="heart_time" class="col-sm-2 control-label no-padding-right">程序心跳间隔</label>
                                <div class="col-sm-6">
                                    <input type="text"    value="{$softwareInfo.heart_time}"  class="form-control" id="heart_time" name="heart_time" placeholder="心跳间隔" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="software_up" class="col-sm-2 control-label no-padding-right">软件更新地址</label>
                                <div class="col-sm-6">
                                    <input type="text"     value="{$softwareInfo.software_up}"     class="form-control" id="software_up" name="software_up" placeholder="类似https://www.lanzous.com/b00t7k1kd" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="software_state" class="control-label col-sm-2 no-padding-right">程序程序状态</label>
                                <div class="col-sm-6">
                                    <select id="software_state" name="software_state" class="form-control">
                                        <option value="0" {if $softwareInfo.software_state == 0}selected{/if}>0</option>
                                        <option value="1" {if $softwareInfo.software_state == 1}selected{/if}>1</option>
                                        
                                       
                                    </select>
                                    <span class="help-block">0代表停用 1代表可用</span>
                                </div>
                            </div>


                            <div class="form-group">
                                <label for="machine_type" class="control-label col-sm-2 no-padding-right">是否强制绑定机器码</label>
                                <div class="col-sm-6">
                                    <select id="machine_type" name="machine_type" class="form-control">
                                        <option value="0" {if $softwareInfo.machine_type == 0}selected{/if}>0</option>
                                        <option value="1" {if $softwareInfo.machine_type == 1}selected{/if}>1</option>
                                        
                                       
                                    </select>
                                    <span class="help-block">0代表不绑定 1代表强制绑定</span>
                                </div>
                            </div>

                            <div class="form-group">
                                <label for="machine_down" class="control-label col-sm-2 no-padding-right">能不能解绑机器</label>
                                <div class="col-sm-6">
                                    <select id="machine_down" name="machine_down" class="form-control">
                                        <option value="0" {if $softwareInfo.machine_down == 0}selected{/if}>0</option>
                                        <option value="1" {if $softwareInfo.machine_down == 1}selected{/if}>1</option>
                                        
                                       
                                    </select>
                                    <span class="help-block">0代表能 1代表不能</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="machine_recoup" class="col-sm-2 control-label no-padding-right">程序解绑扣除点数</label>
                                <div class="col-sm-6">
                                    <input type="text"   value="{$softwareInfo.machine_recoup}"   class="form-control" id="machine_recoup" name="machine_recoup" placeholder="默认填写0" />
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <button type="submit" class="btn btn-primary" id="softwareEdit">修改</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /Page Body -->
</div>
{/block}
{block name="js"}
{__block__}
<script>
    $('#softwareEdit').click(function () {
        $.ajax({
            url:"{:url('admin/software/softwareedit')}",
            type:'post',
            data:$('form').serialize(),
            dataType:'json',
            success:function (data) {
                if (data.code == 1) {
                    layer.msg(data.msg, {
                        icon:6,
                        time:2000
                    }, function () {
                        location.href = data.url;
                    });
                }else {
                    layer.open({
                        title:'程序修改失败',
                        content:data.msg,
                        icon:5,
                        anim:6
                    });
                }
            }
        });
        return false;
    });
</script>
{/block}